package cms.rbac.dao;

import cms.rbac.entity.Item;
import cms.rbac.entity.Permission;
import cms.rbac.entity.Role;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.ArrayList;


@Repository
public interface AuthItemDao {
    boolean addItem(Item item);

    Item findItemByName(String name);

    Role findRoleByName(String name);

    Permission findPermissionByName(String name);

    boolean deleteItemByName(String name);

    boolean deleteAllPermissions();

    boolean deleteAllRoles();

    int updateItem(Item item);

    Role[] findRoles();

    Permission[] findPermissions();

    Permission[] findPermissionsByNames(@Param("names") ArrayList<String> names);
}
